#include <iostream>
#include <iomanip>
using namespace std;

int main() {
	int n;
	cin >> n;
	double m[n];
	double pt;
	for (int i = 0; i < n; i++) {
		cin >> pt;
		if (pt <= 3) {
			m[i] = 5;
		} else {
			m[i] = 5 + (pt - 3) * 2;
			if (m[i] > 40) {
				m[i] = 40;
			}
		}
	}
	for (int i = 0; i < n; i++) {
		cout << fixed << setprecision(2) << m[i] << endl;
	}
	return 0;

}
